<?php $this->context->layout = 'form';?>
<?= \common\widgets\Asset::widget(['type'=>['viewer']])?>
<form class="form-horizontal m" id="form-admin-add">
    <table class="table table-striped">
        <tr>
            <th>申请人</th>
            <td></td>
        </tr>
        <tr>
            <th>校区</th>
            <td><?=$model['campus']?></td>
        </tr>
        <tr>
            <th>姓名</th>
            <td><?=$model['name']?></td>
        </tr>
        <tr>
            <th>性别</th>
            <td><?=$model['sex']?></td>
        </tr>
        <tr>
            <th>手机号</th>
            <td><?=$model['mobile']?></td>
        </tr>
        <tr>
            <th>身份证正面/反面</th>
            <td>
                <div id="id_card">
                    <?php if ($model['id_card_front']):?>
                        <img src="<?=$model['id_card_front']?>" alt="" style="width: 200px">
                    <?php endif;?>
                    <?php if ($model['id_card_front']):?>
                        <img src="<?=$model['id_card_other']?>" alt="" style="width: 200px">
                    <?php endif;?>
                </div>
            </td>
        </tr>
        <?php if ($model['review_status']!==0):?>
            <tr>
                <th>审核状态</th>
                <td>
                    <?=$review_status[$model['review_status']]??''?>
                </td>
            </tr>
            <tr>
                <th>审核备注</th>
                <td>
                    <?=$model['review_remarks']?>
                </td>
            </tr>
            <tr>
                <th>审核时间</th>
                <td>
                    <?=$model['review_time']?>
                </td>
            </tr>
            <?php else:?>
                <tr>
                    <th style="text-align: unset;" class="control-label is-required">审核</th>
                    <td>
                        <?= \common\widgets\FormInput::widget(['name'=>'radio','extend'=>['name'=>'review_status','required'=>1,'data'=>$review_status]])?>
                    </td>
                </tr>
                <tr>
                    <th>审核备注</th>
                    <td>
                        <?= \common\widgets\FormInput::widget(['name'=>'textarea','extend'=>['name'=>'review_remarks']])?>
                    </td>
                </tr>
        <?php endif;?>
    </table>
    <input type="hidden" name="id" value="<?=$model['id']?>">
</form>

<?php $this->beginBlock('script'); ?>
<script>
    new Viewer(document.getElementById('id_card'),{navbar:false,title:false});
    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save("<?=\yii\helpers\Url::to(['running/review'])?>", $('#form-admin-add').serialize());
        }
    }
</script>
<?php $this->endBlock(); ?>
